//
//  SecondViewController.m
//  UI_Homework_08_01
//
//  Created by 黄威 on 16/5/12.
//  Copyright © 2016年 黄威. All rights reserved.
//

#import "SecondViewController.h"

@interface SecondViewController ()
@property (nonatomic,retain)UITextField *textfiele;
@end

@implementation SecondViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    [self create];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
   

    [self create];


}


- (void)create{
    
    
    
    UIButton *button = [UIButton buttonWithType:UIButtonTypeSystem];
    button.frame = CGRectMake(100, 200 , 200, 40);
    button.backgroundColor = [UIColor purpleColor];
    
    [self.view addSubview:button];
    
    
    self.textfiele = [[UITextField alloc]initWithFrame:CGRectMake(100, 100, 200, 40)];
    
    self.textfiele.backgroundColor = [UIColor purpleColor];
    self.textfiele.placeholder = _contectOfsecond;
    
    [self.view addSubview:self.textfiele];
    
    
    [self.textfiele release];
    
    [button addTarget:self action:@selector(handleback) forControlEvents:UIControlEventTouchUpInside];
    
    
    
}


- (void)handleback{
    if ([self.delegate respondsToSelector:@selector(copysecondstring:)]) {
        [self.delegate copysecondstring:self.textfiele.text];
    }
    
    [self.navigationController popViewControllerAnimated:YES];


}


/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
